import request from '@/utils/request'
// 发送短信验证码
export const sendMessageAuthCode = (phoneNum) => {
  return request({
    method: 'GET',
    url: '/api/v1/second-hospital/get-authcode',
    params: {
      phoneNum
    }
  })
}
// 获取就诊卡
export const cardList = data => {
  return request({
    method: 'POST',
    url: '/api/v1/second-hospital/user-organ-cards',
    data
  })
}

// 华西园区科室列表
export const selFirstDept = data => {
  return request({
    method: 'POST',
    url: '/api/v1/second-hospital/sel-tree',
    data
  })
}
// 按更多条件选择医生列表
export const selDoctorListByMoreTerm = data => {
  return request({
    method: 'POST',
    url: '/api/v1/second-hospital/sel-doctor-list',
    data
  })
}

// 创建任务
export const appointmentTasks = data => {
  return request({
    method: 'POST',
    url: '/api/v1/second-hospital/tasks/create',
    data
  })
}

// 任务列表
export const getTasksPages = data => {
  return request({
    method: 'POST',
    url: '/api/v1/second-hospital/tasks/list',
    data
  })
}
export const getTasksMotherPages = data => {
  return request({
    method: 'POST',
    url: '/patientExamination/list',
    data
  })
}
export const deletePatient = (id) => {
  return request({
    method: 'GET',
    url: '/patientExamination/delete',
    params: {
      id
    }
  })
}
export const appointmentCancelOrBack = data => {
  return request({
    method: 'POST',
    url: '/api/v1/second-hospital/cancel',
    data
  })
}
export const appointmentToPay = data => {
  return request({
    method: 'POST',
    url: '/api/v1/appointmentTasks/appointmentToPay',
    data
  })
}
// 删除任务
export const selAppointmentRecord = data => {
  return request({
    method: 'POST',
    url: '/api/v1/second-hospital/record-page',
    data
  })
}

// 获取验证码
export const getImageCode = data => {
  return request({
    method: 'POST',
    url: '/api/v1/second-hospital/get-image-code',
    data
  })
}

// 获取排班
export const selWeekScheduleTwo = data => {
  return request({
    method: 'POST',
    url: '/api/v1/second-hospital/sel-doctor-schedule',
    data
  })
}

// 配置任务
export const configuration = data => {
  return request({
    method: 'POST',
    url: '/api/v1/second-hospital/task/configuration',
    data
  })
}
// 开启或取消任务
export const openOrCancel = (id) => {
  return request({
    method: 'GET',
    url: '/api/v1/appointmentTasks/openOrCancel',
    params: {
      id
    }
  })
}

// 复制任务
export const copy = (id) => {
  return request({
    method: 'GET',
    url: '/api/v1/second-hospital/copy',
    params: {
      id
    }
  })
}

export const checkToken = (id) => {
  return request({
    method: 'GET',
    url: '/api/v1/second-hospital/check-token',
    params: {
      id
    }
  })
}

export const sureAppointment = data => {
  return request({
    method: 'POST',
    url: '/api/v1/second-hospital/sure-order',
    data
  })
}
